package com.bflow.api.bo.draw;

import com.bflow.api.bo.BflowDefineProcessDrawBo;

import java.io.Serializable;
import java.util.List;

public class DrawBo implements Serializable {

    private static final long serialVersionUID = -5884983840553666182L;

    public static  final String NODE_START="Start";
    public static final String NODE_END="End";
    private String nodeKeyProperty="id";
    private List<Node> nodeDataArray;


    private List<Line> linkDataArray;
    private BflowDefineProcessDrawBo draw;

    public DrawBo(){

    }


    public DrawBo(List<Node> nodeDataArray, List<Line> linkDataArray,BflowDefineProcessDrawBo drawBo) {
        nodeDataArray.add(0,new Node(NODE_START,NODE_START,null,"开始","lightgreen","开始") );
        nodeDataArray.add(new Node(NODE_END,NODE_END,null,"结束",null,"结束") );
        linkDataArray.add(new Line(NODE_START,nodeDataArray.get(1).id,"流程开始",""));
        linkDataArray.add(new Line(nodeDataArray.get(nodeDataArray.size()-2).id,NODE_END,"流程结束",null));
        this.nodeDataArray = nodeDataArray;
        this.linkDataArray = linkDataArray;
        this.draw=drawBo;
    }

    public String getNodeKeyProperty() {
        return nodeKeyProperty;
    }

    public void setNodeKeyProperty(String nodeKeyProperty) {
        this.nodeKeyProperty = nodeKeyProperty;
    }

    public List<Node> getNodeDataArray() {
        return nodeDataArray;
    }

    public void setNodeDataArray(List<Node> nodeDataArray) {
        this.nodeDataArray = nodeDataArray;
    }

    public List<Line> getLinkDataArray() {
        return linkDataArray;
    }

    public void setLinkDataArray(List<Line> linkDataArray) {
        this.linkDataArray = linkDataArray;
    }

    public BflowDefineProcessDrawBo getDraw() {
        return draw;
    }

    public void setDraw(BflowDefineProcessDrawBo draw) {
        this.draw = draw;
    }




    public  class Node {

        String id;
        String category;



        String loc;
        String text;
        String color;
        String tip;

        public Node(){};

        public Node(String id, String category, String loc, String text, String color, String tip) {
            this.id = id;
            this.category = category;
            this.loc = loc;
            this.text = text;
            this.color = color;
            this.tip = tip;
        }

        public Node(String id,String text, String color, String tip) {
            this.id = id;
            this.text = text;
            this.color = color;
            this.tip = tip;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getCategory() {
            return category;
        }

        public void setCategory(String category) {
            this.category = category;
        }

        public String getLoc() {
            return loc;
        }

        public void setLoc(String loc) {
            this.loc = loc;
        }

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }

        public String getColor() {
            return color;
        }

        public void setColor(String color) {
            this.color = color;
        }

        public String getTip() {
            return tip;
        }

        public void setTip(String tip) {
            this.tip = tip;
        }


    }

    public  class Line  {

        String from;
        String to;
        String text;
        String lineColor;
        String curviness;

        public Line(){};

        public Line(String from, String to, String text, String lineColor, String curviness) {
            this.from = from;
            this.to = to;
            this.text = text;
            this.lineColor = lineColor;
            this.curviness = curviness;
        }

        public Line(String from, String to, String text, String lineColor) {
            this.from = from;
            this.to = to;
            this.text = text;
            this.lineColor = lineColor;
        }

        public String getFrom() {
            return from;
        }

        public void setFrom(String from) {
            this.from = from;
        }

        public String getTo() {
            return to;
        }

        public void setTo(String to) {
            this.to = to;
        }

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }

        public String getLineColor() {
            return lineColor;
        }

        public void setLineColor(String lineColor) {
            this.lineColor = lineColor;
        }

        public String getCurviness() {
            return curviness;
        }

        public void setCurviness(String curviness) {
            this.curviness = curviness;
        }




    }
}
